<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>let</title>
  </head>
  <body>
    <script>
      // 声明变量
      let a;
      let b, c, d;
      let e = 100;
      let f = 1,
        g = "a",
        h = [];
      // 1.不能重复声明
      let star = "star";

      // 2.块级作用域
      {
        let girl = "girl";
      }
      // console.log(girl);  not defined

      // 3.不存在变量提升
      // console.log(song);
      // let song = "青花瓷";

      // 4.不影响作用域链
      {
        let a = "a";
        function fn() {
          console.log(a);
        }
        fn();
      }
    </script>
  </body>
</html>
